package com.example.demo.modules.customDefine.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.modules.customDefine.entity.FieldType;
import com.example.demo.modules.customDefine.mapper.FieldTypeMapper;
import com.example.demo.modules.customDefine.service.FieldTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class FieldTypeServiceImpl extends ServiceImpl<FieldTypeMapper, FieldType> implements FieldTypeService {

    @Autowired
    private FieldTypeMapper fieldTypeMapper;

    //查询所有
    @Override
    public List<FieldType> listAll() {
        List<FieldType> fieldTypes = this.list();
        return fieldTypes;
    }

    //条件查询
        @Override
    public FieldType listOne(Long id) {
        FieldType fieldType = this.getById(id);
        return fieldType;
    }

    //保存
        @Override
    public int insert(FieldType fieldType){
        return fieldTypeMapper.insert(fieldType);

    }

}
